{% extends "base_documentation.html" %}
{%block title%}
Kullanıcı grup tanımlamaları 
{%endblock%}
{%block content%}
<fieldset class="module aligned ">
{% if grps %}
<table>
	<tr>
	<th>&nbsp;</th>
	<td><label for="id_name">Yeni Grup&nbsp;:</label></td>
	</tr>
	<tr>
	<th>&nbsp;</th>
    <td><form action="/documentation/accounts/groups/add/" method="post">
    {{form.name}}<input type="submit" onclick="this.disabled=true;this.value='ekliyor..';this.form.submit();" value="Ekle">
    </form>
    </td>
	</tr>
    <tr>
    <th></th>
    <td>
    <div id="itsthetable" >
		<table>
		<caption>Kullanıcı Grupları</caption>
		<tbody>
		{% for grp in grps %}
		<tr>
			<th>{{forloop.counter}}</th>
			<td><a href="/documentation/accounts/groups/{{grp.id}}/edit/">{{grp.name}}</a></td>
			<td><a href="/documentation/accounts/groups/{{grp.id}}/delete/">Sil?</a></td>
		</tr>
		{% endfor%}
		</tbody>
		</table>
    </div>
    </td>
	</tr>
</table>

    
{% endif %}
{%if grpform%}
	<div class="form-row category  ">
	 <div id="itsthetable" >
		<table>
		<caption>{{grpinstance.name}} Tanımlamaları</caption>
		<tbody>
		<form action="/documentation/accounts/groups/{{grpinstance.id}}/save/" method="post">
		 {{grpform}}
		</tbody>
		</table>
    </div>
    </div>
    <div class="form-row category  ">
    <input type="submit" onclick="this.disabled=true;this.value='Bekleyiniz..';this.form.submit();" value="Kaydet">
    <a href="/documentation/accounts/groups/">Geri Dön</a>
    </form>
    
	</div>	
{%endif%}
{% if grpdeleteform %}
<div id="contentdiv">  
	{% for grp in grp %}
	<div class="form-row category  ">
	<table>
		<tr>
			<td style="width: 100%;"><ul><li><font style="font-size: 12px;"><font color="brown">"{{grp.name}}"</font> grubunu <u>silmek</u> üzeresiniz. Emin misiniz?<br>
			{% for u in grp.user_set.all %}
			{% ifequal forloop.counter 1%}Şu an bu <i><font color="brown">{{grp.name}}</font></i> grubuna bağlı olan aşağıdaki kullanıcılar, ilgili gruptan çıkarılacaktır:<br>{%endifequal%}
			<ul><li>{{u.get_full_name|lower|capfirst}}</li></ul>
			{% endfor %}
			</li></ul>
			</font></td>
		</tr>
		
	
		<tr>
			<td style="width: 50%;" align="right"><form method="POST" action="/documentation/accounts/groups/{{grp.id}}/godelete/"><input type="submit"  onclick="this.disabled=true;this.value='Siliyor..';this.form.submit();" value="Şimdi Sil"/></form></td>
			<td align="left"><form method="POST" action="/documentation/accounts/groups/"/><input type="submit" value="Vazgeç"></form></td>
		</tr>
	</table> 	
	
	</div>
	{% endfor %}

</div>

{% endif %}
</fieldset>


{%endblock%}
{%block script%}
<link rel="stylesheet" type="text/css" href="/media/css/forms.css" />
<link rel="stylesheet" type="text/css" href="/media/css/table-orange.css" />
{%endblock%}